import 'package:color_dart/RgbaColor.dart';
import 'package:flutter/material.dart';
import 'package:im_flutter_sdk_example/components/labels/index.dart';

class CommmentItem extends StatelessWidget {
  final name;
  final content;
  final num;
  final time;
  CommmentItem({Key key, this.name, this.content, this.num, this.time})
      : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white60,
      padding: EdgeInsets.fromLTRB(18, 20, 18, 0),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Image.asset(
            'lib/assets/images/default_avatar.png',
            width: 26,
            height: 26,
            fit: BoxFit.cover,
          ),
          Expanded(
            child: Container(
              margin: EdgeInsets.only(left: 10),
              padding: EdgeInsets.only(bottom: 11),
              decoration: BoxDecoration(
                  border: Border(
                      bottom:
                          BorderSide(color: rgba(245, 245, 245, 1), width: 1))),
              child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Row(
                          children: [
                            Text('$name',
                                style: TextStyle(
                                    color: rgba(68, 68, 68, 1), fontSize: 14)),
                            LabelVipLeavel(),
                          ],
                        ),
                        Row(
                          children: [
                            LabelThumbsUp(),
                            Padding(
                              padding: EdgeInsets.only(left: 2),
                              child: Text(
                                '$num',
                                style: TextStyle(
                                    color: rgba(163, 163, 163, 1),
                                    fontSize: 12),
                              ),
                            ),
                          ],
                        )
                      ],
                    ),
                    Container(
                      child: Text('$content', maxLines: 2),
                      margin: EdgeInsets.only(bottom: 12, top: 8),
                    ),
                    Text('$time',
                        style: TextStyle(
                            color: rgba(163, 163, 163, 1), fontSize: 12)),
                  ]),
            ),
          )
        ],
      ),
    );
  }
}
